import request from '@/utils/request'
const api_name = '/edu/service/chapter'
const api_video_name = '/edu/service/video'
export default {
    // 查询所有的章节小节信息
    getAllChapterVideo(courseId) {
        return request({
            url: `${api_name}/getChapterVideo/${courseId}`,
            method: 'get'
        })
    },
    // 添加章节
    addChapterInfo(chapter) {
        return request({
            url: `${api_name}/addChapter`,
            method: 'post',
            data: chapter
        })
    },
    // 根据Id查询章节
    getChapterById(chapterId) {
        return request({
            url: `${api_name}/getChapterInfo/${chapterId}`,
            method: 'get'
        })
    },
    // 根据Id修改章节
    updateChapter(chapter) {
        return request({
            url: `${api_name}/updateChapter`,
            method: 'post',
            data: chapter
        })
    },
    // 根据Id删除章节
    deleteChapter(chapterId) {
        return request({
            url: `${api_name}/deleteChapter/${chapterId}`,
            method: 'delete'
        })
    },
    // 添加小节
    addVideoInfo(video) {
        return request({
            url: `${api_video_name}/addVideo`,
            method: 'post',
            data: video
        })
    },
    // 根据Id查询章节
    getChapterById(videoId) {
        return request({
            url: `${api_video_name}/getVideo/${videoId}`,
            method: 'get'
        })
    },
    // 根据Id修改章节
    updateChapter(video) {
        return request({
            url: `${api_video_name}/updateVideo`,
            method: 'post',
            data: video
        })
    },
    // 根据Id删除章节
    deleteChapter(videoId) {
        return request({
            url: `${api_video_name}/deleteVideo/${videoId}`,
            method: 'delete'
        })
    }
}
